<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>登陆页面 </title>
    <link rel="stylesheet" href="/home/css/reset.css">
    <link rel="stylesheet" href="/home/css/head-footer.css">
    <link rel="stylesheet" href="/home/css/login.css">
    <style type="text/css">
        .font{
            font-size: 200%;
            margin-left: 280px;
            font-weight: bold;
            margin-top: 30px;
            color: #ff9900;
        }
    </style>
</head>

<body>
<!-- 头部 -->
<div class="header-wrap">
    <div class="header-top-wrap">
        <div class="header-top clearfixa">
            <div class="logo-box fl">
                <a href="javascript:void(0)">
                    <img src="/home/images/logo.png" alt="">
                </a>
            </div>
            <div class="login-api-box fr">
                <span><a href="{:url('login/login')}">登录</a></span>/
                <span><a href="{:url('login/index')}">注册</a></span>
            </div>
        </div>
    </div>
    <div class="header-bottom-wrap">
        <div class="header-bottom">
            <div class="second-logo-box">
                <a href="javascript:void(0)">
                    <img src="/home/images/teacher-logo.png" alt="">
                </a>
            </div>
        </div>
    </div>
</div>
<!-- 主体内容 -->
<div class="login-main-wrap">
    <div class="second-nav">
        <span><a href="javascript:void(0)">首页</a></span>
        >
        <span><a href="javascript:void(0)">登录</a></span>
    </div>
    <div class="login-main-box login1-main-box">
        <div class="font">商家登陆页面</div>
        <h1 class="login-speed-api"><a href="{:url('login/index')}">快速注册</a></h1>
        <div class="login-main">
            <form>
                <label for="" class="login-information-box">
                    <span class="login-information-name">手机：</span>
                    <input type="text" placeholder="请输入手机" name="agent_username" id="agent_username">
                </label>
                <label for="" class="login-information-box">
                    <span class="login-information-phone">密码：</span>
                    <input type="password" placeholder="请输入密码" name="agent_password" id="agent_password">
                </label>
                <input class="login-submit" type="button" id="button" value="提交">
            </form>
        </div>
    </div>
</div>
{include file='base/footer' /}
</body>


</html>
<script src="http://libs.baidu.com/jquery/2.1.1/jquery.min.js"></script>
<script src="/home/js/layer-v/layer/layer.js"></script>
<script>
    $(document).on('click','#button',function(){

        var agent_username = $('#agent_username').val();
        var agent_password = $('#agent_password').val();

        if(agent_password !== "" || agent_username !== "")
        {
            $.ajax({
                url:"{:url('login/dologin')}",
                data:{
                    agent_username : agent_username,
                    agent_password : agent_password,
                },
                dataType:'json',
                type:'post',
                success:function(data)
                {
                    // console.log(data);return false;
                    if(data.code == '1000')
                    {
                        layer.msg('登陆成功', {
                            icon: 16,
                            shade: 0.01
                        });
                        window.location.href = "{:url('Base/index')}";

                    }else if(data.code == '1002')
                    {
                        layer.msg('申请未审核', function(){
                            //关闭后的操作
                            return false;
                        });
                    }else if(data.code == '1001')
                    {
                        layer.msg('申请未审核', function(){
                            //关闭后的操作
                            return false;
                        });
                    }else {
                        layer.msg('登陆失败', function(){
                            //关闭后的操作
                            return false;
                        });
                    }
                }
            })
        }else
        {
            layer.msg('请填写完整', function(){
                //关闭后的操作
                return false;
            })
        }


    })
</script>

</html>

